<?php
class Pageley_Controller_Session_Http implements Pageley_Controller_Session {
	
	public function get($name) {
        $result = null;
        if(array_key_exists($name, $_SESSION)) {
            $result = $_SESSION[$name];
        }
        return $result;
    }

    public function set($name, $value) {
        $_SESSION[$name] = $value;
    }

    public function remove($name) {
        unset($_SESSION[$name]);
    }
    
    public function getLocale() {
        $locales = $this->get("pageley.locales");
    	$locale = null;
        if($locales !== null && $locales->size() > 0) { 
            $locale = $locales->get(0);
        } else {
        	$locale = Pageley_I18n_Locale::$EN;
        }
    	return $locale;
    }
}